#include "Acceptor.hpp"
#include "TcpConnection.hpp"
#include <iostream>
#include <string>

using std::cout;
using std::endl;

int main()
{
    wd::Acceptor acceptor(9090);
    acceptor.ready();
    
    cout << "服务端启动成功！等待客户端连接..." << endl;


    wd::TcpConnection conn(acceptor.accept());

    cout << conn.toString() << " 已连接 ！" << endl;

    string msg = conn.receive();

    cout << "客户端：" << msg << endl;

    conn.send(msg);


    return 0;
}
